﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="~/plugins/mzui/js/mzui.min.js"></script>
    <link href="~/plugins/mzui/css/mzui.min.css" rel="stylesheet" />
    <title>我的会员</title>
</head>
<body class="with-nav-bottom">
    <table class="table bordered white">
        <thead>
            <tr>
                <th class="title text-center" onclick="fs();"><div id="fs" class="label success outline rounded">@(Request.QueryString["number"] == "0" ? "查询总数" : "总数=" + Request.QueryString["number"])</div></th>
                <th class="title text-center">分享者</th>
                <th class="title text-center">@ViewBag.account @ViewBag.real_name</th>
            </tr>
            <tr class="purple-pale">
                <th>邀请会员</th>
                <th>会员等级</th>
                <th>会员帐号<div class="label info outline pull-right">一级</div></th>
            </tr>
        </thead>
        <tbody id="tbody">
            <script id="tpl" type="text/html">
                {{each list as item index}}
                <tr onclick="url('{{item.gid}}','{{item.real_name}}','{{item.grade}}','{{item.number}}')">
                    <td>{{item.real_name}}{{item.number!=0?"(" + item.number +")":""}}</td>
                    <td>{{item.grade}}</td>
                    <td>{{item.account}} <i class="icon icon-chevron-right primary pull-right {{item.number==0?"hidden":""}}"></i></td>
                </tr>
                {{/each}}
            </script>
        </tbody>
        <tfoot>
            <tr>
                <th colspan="3" id="nextpage" class="title text-center" onclick="getlist(document.getElementById('pageindex').innerHTML,0);">显示更多 <i class="icon icon-double-angle-down"></i></th>
            </tr>
        </tfoot>
    </table>
    <nav class="nav affix dock-bottom justified">
        <a onclick="history.go(-1);" class="primary"><i class="icon-5x icon-arrow-left"></i></a>
    </nav>
    <label id="pageindex" class="hidden">0</label><label id="pages" class="hidden">1</label>
    <label id="Controllers" class="hidden">/shop/userlist</label>
    <script src="~/js/template-web.js"></script>
    <script src="~/js/mlist.js"></script>
    <script>
        function url(gid, real_name, grade, number) {
            if (number != 0) {
                self.location = "/home/tjr?gid=" + gid + "&real_name=" + real_name + "&grade=" + grade;
            }
        }
        function fs() {
            $.ajax({
                url: "/ajax/api.ashx",
                data: "ff=fs&Cache=" + Math.random(),
                type: "post",
                cache: false,
                timeout: 30000,
                dataType: "json",
                ContentType: "application/json; charset=utf-8",
                error: function () { $("#fs").html("查询异常"); },
                beforeSend: function () { $("#fs").html("统计中..."); },
                success: function (data) {
                    if (data.result == 200) {
                        $("#fs").html("总数=" + data.data);
                    }
                    else {
                        $("#fs").html("查询失败");
                    }
                },
            });
        }
    </script>
</body>
</html>
